﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ZG</title>
    <link href="../../Content/Themes/blue2/css.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .lan
        { 
            position: absolute;
            right: 18px;
            top: 0px;
            padding: 0;
            margin: 0;
            padding-top: 0;
            width: 60px;
            background: #f5f5f5;
        }

            .lan li
            {
                clear: both;
                display: block;
                line-height: 20px;
                padding: 0 5px;
                width: 50px;
            }

                .lan li:hover
                {
                    background: #d2d2d2;
                }
    </style>
    

    <script src="../../Content/JS/Simple.js" type="text/javascript"></script>
    <script src="../../Content/JS/eqccd.js" type="text/javascript"></script>
    <script src="../../Content/JS/ExDate.js" type="text/javascript"></script>
</head>
<body class="header" style="background-image: url(../../Content/Themes/blue2/top_bg.png?635326393543154296);">
    <div class="contaier" style="background-image: url(../../Content/Themes/blue2/banner.png?635326393543154296)">
     
        <div class="nav" id="nav">
            <ul id="navul">
                
                        <li onclick="switchMenu(this,1)"><span></span><span class="m">
                            会员管理中心</span><span class="r"></span></li>
                    
                        <li onclick="switchMenu(this,2)"><span></span><span class="m">
                            基本设置</span><span class="r"></span></li>
                    
                        <li onclick="switchMenu(this,3)"><span></span><span class="m">
                            系统设置</span><span class="r"></span></li>
                    
                        <li onclick="switchMenu(this,4)"><span></span><span class="m">
                            查询图表</span><span class="r"></span></li>
                    
                        <li onclick="switchMenu(this,5)"><span></span><span class="m">
                            收入明细</span><span class="r"></span></li>
                     
                    
            </ul>
            <div style="clear: both">
            </div>
        </div>
        <div style="clear: both">
        </div>
        <div class="tool">
            <a href="javascript:setOnline()" id="imLink" class="t3" title="即时消息"></a><a href="Settings/Personalize.aspx" target="main" class="t1" title="个性设置"></a><a href="javascript:" onmouseover="showLan()" target="main" class="t2" title="语言"></a><a href="http://help.eqccd.com/help_center/index.aspx" target="_blank" class="t4" title="帮助"></a><a href="javascript:exitSys()" class="t5" title="退出"></a>
            <ul id="lan" class="lan" style="padding: 0; display: none">
                
                <li onclick="chgLan(0)">简体中文</li>
                
            </ul>
        </div>
        
        <script type="text/javascript">
            var list = $("#navul li");
            var nav = $("#nav");
            var navul = $("#navul")
            var scroll = $("#scroll");
            var btn = scroll.find("a");
            var desktop = $("#desktop");
            var lan = $("#lan");
            var hidLan = $("hidLan");
            var _width = 0;
            var _total = 0;
            var _totaltmp = 0;
            var MAXITEM = 6;

            setNav();
            window.onresize = setNav;
            var timer;
            function setNav() {
                _width = 0;
                _total = 0;
                _totaltmp = 0;
                nav[0].scrollLeft = 0;
                MAXITEM = 6;
                var additem = parseInt((document.documentElement.clientWidth - 1024) / 80);
                if (additem > 0)
                    MAXITEM += additem;
                else
                    MAXITEM = 6;

                for (var i = 0; i < list.length; i++) {
                    if (i < MAXITEM)
                        _width += list[i].clientWidth + 1;
                    _total += list[i].clientWidth + 1;
                }
                nav.size(_width, null);
                navul.size(_total, null);
                _totaltmp = _total = _total - _width;
                if (list.length > MAXITEM) {
                    scroll.show();
                    btn[0].style.visibility = "hidden";
                    btn[1].style.visibility = "";
                }
                else {
                    scroll.hide();
                }
            }

            function stop(t) {
                clearInterval(timer);
                if (_totaltmp <= 0)
                    btn[1].style.visibility = "hidden";
                if (_totaltmp >= _total)
                    btn[0].style.visibility = "hidden";
            }
            function showLan() {
                lan.show();
            }

            lan.bindEvent("mouseout", function (e) {
                try {
                    if (lan.contains($.event.to(e))) return;
                    lan.hide();
                } catch (e) { lan.hide(); }
            });
            function chgLan(v) {
                var old = parseInt($.cookie.get("IOALanguage"));
                if (old == v) {
                    lan.hide();
                }
                else {
                    lan.hide();
                    $.cookie.set("IOALanguage", v, 100);
                    window.location.reload();
                    window.parent.document.getElementById("menu").contentWindow.location.reload();
                    window.parent.document.getElementById("main").contentWindow.location.reload();
                    window.parent.document.getElementById("online").contentWindow.location.reload();
                    try {
                        window.parent.document.getElementById("footer").contentWindow.location.reload();
                    } catch (e) { }
                }
            }
            function next() {
                if (_totaltmp <= 0) return;
                btn[0].style.visibility = "visible";
                timer = setInterval(function () {
                    _totaltmp -= 10;
                    nav[0].scrollLeft += 10;
                    if (_totaltmp <= 0) {
                        stop(true);
                    }
                }, 50);
            }
            function prev() {
                if (_totaltmp >= _total) return;
                btn[1].style.visibility = "visible";
                timer = setInterval(function () {
                    _totaltmp += 10;
                    nav[0].scrollLeft -= 10;
                    if (_totaltmp >= _total) {
                        stop(false);
                    }
                }, 50);
            }
            function switchMenu(o, id, url) {
                if (o) {
               
                    list.css("");
                  //  desktop.css("");
                    o.className = "hover";
                }
                if (id)
                //window.parent.document.getElementById("menu").contentWindow.location.href = "menu.aspx?id=" + id;
                    window.parent.document.getElementById("menu").contentWindow.location.href = " /Menu/Index?id=" + id;
                if (url)

                    window.parent.document.getElementById("menu").contentWindow.settting(url);
            }
         

            function setOnline() {
                var m = window.parent.document.getElementById('box');
                var o = window.parent.document.getElementById('online');
                if (m.cols == "155,6,*,140,6") {
                    m.cols = "155,6,*,0,6";
                    o.contentWindow.location.href = "line.aspx";
                }
                else {
                    o.contentWindow.location.href = "online.aspx";
                    m.cols = "155,6,*,140,6";

                }
            }


            function exitSys() {
                if (confirm('您确定要退出系统吗？'))
                    window.parent.location = 'LogOut.aspx?sysopt=exit';
            }
        </script>

        <input name="txtOff" type="hidden" id="txtOff" value="0" />
        <input name="txtCallRecordID" type="hidden" id="txtCallRecordID" />
        

        <script type="text/javascript">
            var cpe_id;
            var PopObject;
            var UsbPhoneCtrl1;
            window.onload = function Initialization() {
                //来电显示控制			
                var iOff = parseInt(document.getElementById("txtOff").value);
                if (iOff <= 0) return;
                try {
                    UsbPhoneCtrl1 = document.getElementById("UsbPhoneCtrl");
                    addLog(UsbPhoneCtrl1.readyState);
                } catch (e) { }
                try {
                    cpe_id = YeahDone1.OpenCPE();
                    YeahDone1.SetPhoneListenSpan(45); //单位为秒,来电后超过设置的时间则判断此电话为未接电话					
                }
                catch (e) { }
            }

            function openComing(callTime, callNumber) {
                callTime = callTime.Format("yyyy-MM-dd HH:mm:ss");
                if (PopObject != null) {
                    if (!PopObject.closed) {
                        PopObject.frames["leftarea"].document.getElementById("txtCallNumber").value = callNumber;
                        PopObject.frames["leftarea"].document.getElementById("txtCallTime").value = callTime;
                        PopObject.frames["leftarea"].funRefreshList();
                        return;
                    }
                }
                PopObject = qc.openWindow("/CRM/CallScreenFrame.aspx?IncomingNum=" + callNumber + '&CallTime=' + callTime, 1000, 600);
            }

            function addLog(log) {
                //var div = document.getElementById("test");
                //if (!div) {
                //    div = document.createElement("div");
                //    div.id = "test";
                //    document.body.appendChild(div);
                //}
                //div.innerHTML = div.innerHTML + "<br/>" + log;
            }
        </script>

        <!-- 来电盒--start-->
        <script for="YeahDone1" event="OnPhoneIncoming(cpe_id,IncomingNum)" type="text/javascript">
            if (IncomingNum.length > 2) {
                openComing(new Date(), IncomingNum);
            }
        </script>
          <script for="YeahDone1" event="OnPhoneListened(cpe_id, bVal)" type="text/javascript">
              if (bVal) {
                  //更新来电状态为已接
                  var callRecordID = $("#txtCallRecordID").val();
                  if (callRecordID) {
                      dt = null;
                      qc.post('CRM_Core.dll', 'CRM_Core.CallRecord', { "Key": "CallRecord", "CallRecordID": callRecordID },
                      function () {
                          if (PopObject != null) {
                              if (!PopObject.closed) {
                                  var sCurrID = PopObject.frames["main"].document.getElementById("txtPK_ID").value
                                  if (sCallRecordID == sCurrID)//判断弹屏显示的来电和最新的来电是否一致
                                  {
                                      if (PopObject.frames["main"].funSelCallState) {
                                          PopObject.frames["main"].funSelCallState(1);
                                      }
                                  }
                              }
                          }
                      });
                  }
              }
        </script>
        <script event="OnDeviceDetect(bState,cpe_id)" for="YeahDone1" type="text/javascript">
            if (bState) {
                //来电设备发生变化的事件（连接设置／移走设置）
                cpe_id = YeahDone1.OpenCPE();
            }
        </script>
        <!-- 来电盒--end-->


        <!--电话机--start-->
        <script type="text/javascript" for="UsbPhoneCtrl" event="OnComingCall(date, callNumber, callName)" defer>
            openComing(new Date(date), callNumber);
        </script>

        <script language="JavaScript" for="UsbPhoneCtrl" event="UsbPhoneEvent(EventX,Param)" defer>
            addLog('Event: UsbPhoneEvent(EventX,Param) EventX=' + EventX + ', Param=' + Param);
        </script>

        <script type="text/javascript" for="UsbPhoneCtrl" event="UsbPlug(IsPlugIn)" defer>
            addLog("Event: UsbPlug(IsPlugIn) IsPlugIn=" + IsPlugIn);
        </script>

        <script type="text/javascript" for="UsbPhoneCtrl" event="OnRing()" defer>
            addLog("Event: OnRing()");
        </script>
    
        <!--电话机 --  end -->

        
    </div>
        <div class="scroll" id="scroll">
            <a class="s1" href="javascript:" onmouseover="prev();" onmouseout="stop();" style="visibility: hidden"></a>&nbsp;<a class="s2" href="javascript:" onmouseover="next();" onmouseout="stop();"></a>
        </div>
        </body>
</html>